POV-Ray : Newsgroups : povray.unofficial.patches : Announce: SkyPOV 0.1 : Re: Announce: SkyPOV 0.1 Server Time
31 Jul 2024 02:26:03 EDT (-0400)
  Re: Announce: SkyPOV 0.1  
From: Mark Wagner
Date: 7 Nov 2000 00:43:56
Message: <3a07969c@news.povray.org>
Chris Huff wrote in message ...
>In article <3a06459f$1@news.povray.org>, "Mark Wagner"
><mar### [at] gtenet> wrote:
>
>> >I don't have any experience with growing dynamically allocated
>> >arrays...I tend to use linked lists for everything.
>> I've already got the code for this written -- it's just a matter of
>> copying it from my personal version to SkyPOV.
>


Update: I implemented it today.  For unknown reasons, POV_REALLOC doesn't
work properly for this.  I'm using Borland C++ Builder 4.0, if that makes
any difference.

>
>> I think that, usage-wise, it would be better to use the array syntax.
>>  This would allow points to be changed and read using a single
>> syntax.
>
>Arrays don't have any special syntax for insertion...and I don't think
>reading the points with [] brackets will be very easy. As for changing
>existing points...what would this do?
>#declare Spl[2] = 0.4;


The obvious fix would be to do something like
#declare Spl[2].x = 0.4; // Sets the x value at the fourth item
#declare Spl[2].y = 0.4; // Sets the y value at the fourth item
#declare Spl[2].z = 0.4; // Sets the z value at the fourth item
#declare Spl[2].red = 0.4; // Sets the red value at the fourth item (same as
.x)
#declare Spl[2].green = 0.4; // Sets the green value at the fourth item
(same as .y)
#declare Spl[2].blue = 0.4; // Sets the blue value at the fourth item (same
as .z)
#declare Spl[2].filter = 0.4; // Sets the filter value at the fourth item
#declare Spl[2].transmit = 0.4; // Sets the transmit value at the fourth
item
#declare Spl[2].t = 0.4; // Sets the t value


Arrays of splines would be treated as multi-dimensional arrays, with the
last dimension being the spline index.

>Adding a point should be possible already, it should work fine with the
>modifications I made(mainly the fix to Copy_Spline()). Just do something
>like this:
>#declare Spline = spline {Spline NEW_POINTS}


It does.

>And one other thing that should probably be taken care of: multiple
>points with the same t value should probably not be allowed. New points
>with the same t value of an existing point should replace that point. I
>don't remember seeing anything about this in the source code...


The source code doesn't do anything about this right now.  I'll add that to
my list of things to do.

On the lines of splines and the problems with them:
1) Parse_Spline() will accept "quadratic_spline", but quadratic splines does
not exist.  They are treated as cubic splines.

2) Cubic interpolation is not done properly.  It appears that the "cubic
interpolation" is actually done by averaging two quadratic interpolations of
the spline data.  Fixing this will result in minor changes to all scenes
that use cubic splines.

--
Mark


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.